import request from '@/utils/request'
// 策略搜索
export const getTactics = (params) => request({
  url: '/vm-service/policy/search',
  method: 'GET',
  params
})
// 删除策略
export const delTactics = (policyId) => request({
  url: '/vm-service/policy/' + policyId,
  method: 'DELETE'
})

// 新增策略
export const addTactics = (data) => request({
  url: '/vm-service/policy',
  method: 'POST',
  data
})

// 修改策略
export const updateTactics = (data) => request({
  url: '/vm-service/policy/' + data.policyId,
  method: 'PUT',
  data
})

// 查询售货机策略
export const getvmPolicy = (innerCode) => request({
  url: '/vm-service/policy/vmPolicy/' + innerCode,
  method: 'GET'
})

// 根据策略搜索售货机
export const getvmList = (policyId, params) => request({
  url: '/vm-service/policy/vmList/' + policyId,
  method: 'GET',
  params

})

// 订单搜索
export const orderList = (params) => request({
  url: '/order-service/order/search',
  method: 'GET',
  params
})

// 合作商点位汇总统计
export const nodeCollect = () => request({
  url: '/vm-service/node/nodeCollect',
  method: 'GET'
})
// 获取一定时间范围之内的分成总数
export const totalBill = (start, end) => request({
  url: '/order-service/report/totalBill',
  method: 'GET',
  params: {
    start,
    end
  }

})

// 获取一定时间范围之内的收入
export const orderAmount = (start, end) => request({
  url: '/order-service/report/orderAmount',
  method: 'GET',
  params: {
    start,
    end
  }
})
// 获取一定时间范围之内的订单总数
export const orderCount = (start, end) => request({
  url: '/order-service/report/orderCount',
  method: 'GET',
  params: {
    start,
    end
  }

})
// 获取一定日期范围之内的合作商分成汇总数据
export const partnerCollect = (data) => request({
  url: '/order-service/report/partnerCollect',
  method: 'GET',
  data
})
